package week07.MidEx;

import java.util.Random;

public class PlaneInAirPort implements AirPort{
    private Plane plane;
    public PlaneInAirPort(Plane plane){
        this.plane=plane;
    }
    @Override
    public void schedule() {
     Random rdm=new Random();
     if(rdm.nextBoolean()){
         System.out.println("飞机允许起飞");
         plane.takeOff();
     }
     else {
         System.out.println("飞机不允许起飞");
     }
    }
}
